package com.demo.core.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.demo.base.model.WebUserForPerson;
import com.demo.core.dao.WebUserForPersonDao;

@Transactional
@Service
public class WebUserForPersonService {

	@Autowired
	private WebUserForPersonDao webUserForPersonDao;
	
	/**
	 * 添加网上个人用户
	 * @param webUserForPerson
	 */
	public void addWebUserForPerson(WebUserForPerson webUserForPerson){
		
		webUserForPersonDao.add(webUserForPerson);
	}
	
	/**
	 * 修改网上个人用户
	 * @param webUserForPerson
	 */
	public void updateWebUserForPerson(WebUserForPerson webUserForPerson){
		
		webUserForPersonDao.update(webUserForPerson);
	}
	
	/**
	 * 删除网上个人用户
	 * @param webUserForPerson
	 */
	public void deleteWebUserForPerson(WebUserForPerson webUserForPerson){
		
		webUserForPersonDao.delete(webUserForPerson);
	}
	
	/**
	 * 得到网上用户
	 * @param id
	 * @return
	 */
	public WebUserForPerson getWebUserForPerson(String id){
		
		return (WebUserForPerson) webUserForPersonDao.get(WebUserForPerson.class, id);
	}
	
	/**
	 * 网上用户登录
	 * @param loginName
	 * @param password
	 * @return
	 */
	public WebUserForPerson authWebUserForPerson(String loginName,String password){
		
		return webUserForPersonDao.authWebUserForPerson(loginName, password);
	}
}
